
$(document).ready(function() {
});

function editCT(idphieu, url)
{
	url = url + "&idPhieu=" + encodeURIComponent(idphieu);
	location.href = url;
	//var win = window.open(url, '_blank');
}

function deleCT(journalid,year, soct, idphieu, urlDel, url)
{
	if (!confirm('Bạn muốn xóa chứng từ  '+ soct+' ?')) {
		return;
	} 
	

	jQuery.ajax({
       type: "POST",
       url: urlDel,
	   data: {journalid: journalid,year: year, idphieu:idphieu, url: url},
       cache: false,
       success: function(response)
       {
		   if (response == 1)
		   {
			  alert("Đã xóa xong! ");
			  location.href = url;
		   }
		   else
		   {
		   alert("Co loi du lieu, khong xoa duoc!\n"+response);
		   }
       },
	
	   error: function(data, errorThrown)
	  {
		  alert('request failed :'+errorThrown);
	  }
     });
	
}

function Ret(url)
{
	var Nam=document.getElementById('ttNam').innerHTML;
	url = url + "?Nam="+Nam;
	location.href = url;
	//var win = window.open(url, '_blank');

}

